package com.bawei.module_moto_circle.http

import com.bawei.lib_common.base.BaseResponse
import com.bawei.module_moto_circle.model.CommentInfo
import com.bawei.module_moto_circle.model.CommentModel
import com.bawei.module_moto_circle.model.MotoCircleNavigationItem
import com.bawei.module_moto_circle.model.PostDetailModel
import com.bawei.module_moto_circle.model.PostInfo
import com.bawei.module_moto_circle.model.PostModel
import com.bawei.module_moto_circle.model.SearchKeywordModelItem
import com.bawei.module_moto_circle.model.TopicsModel
import retrofit2.http.GET
import retrofit2.http.Query

/**
 *作者：lxy
 *功能:
 *时间：2025/5/29
 */
interface MotoCircleApi {

    @GET("/app/motorCircle/navigationItem")
    suspend fun navigationItem(): BaseResponse<List<MotoCircleNavigationItem>>

    /**
     * 是否有关注的人
     */
    @GET("/app/friend/checkIfHasFocus")
    suspend fun checkIfHasFocus(): BaseResponse<Boolean>

    /**
     * 分页获取帖子数据
     */
    @GET("/app/postsInfo/pageList")
    suspend fun getPostInfo(
        @Query("pageNum") pageNum: Int,
        @Query("pageSize") pageSize: Int,
        @Query("isFocus") isFocus: Int? = null,
        @Query("keyword") keyword: String? = null,
        @Query("memberId") memberId: String? = null,
        @Query("sortType") sortType: String? = null,
        @Query("topicId") topicId: String? = null
    ): BaseResponse<PostModel>

    /**
     * 校验帖子
     */
    @GET("/app/postsInfo/giveValidationLike")
    suspend fun giveValidationLike(
        @Query("postsId") postsId: String
    ): BaseResponse<Boolean>

    /**
     * 点赞帖子
     */
    @GET("/app/postsInfo/giveLike")
    suspend fun giveLike(
        @Query("postsId") postsId: String
    ): BaseResponse<Boolean>

    /**
     * 关注或取消关注
     */
    @GET("/app/friend/follow")
    suspend fun followOrCancel(@Query("memberId") memberId: String): BaseResponse<Boolean>

    @GET("/app/friend/getFollowedUsers")
    suspend fun getFollowedUsers(
        @Query("pageNum") pageNum: Int = 1,
        @Query("pageSize") pageSize: Int = 10
    )

    /**
     * 帖子详情
     */
    @GET("/app/postsInfo/getByPostsId")
    suspend fun getByPostsId(@Query("postsId") postsId: String): BaseResponse<PostInfo>

    /**
     * 热门话题推荐
     */
    @GET("/app/search/hotTopics")
    suspend fun hotTopics(): BaseResponse<TopicsModel>

    /**
     * 搜索
     */
    @GET("/app/search/searchKeywordList")
    suspend fun searchKeywordList(@Query("keyword") keyword: String): BaseResponse<List<SearchKeywordModelItem>>

    /**
     * 评论
     */
    @GET("/app/postsComment/pageComment")
    suspend fun queryPostCommentsByPage(
        @Query("pageNum") pageNum: Int,
        @Query("pageSize") pageSize: Int,
        @Query("postsId") postsId: String
    ): BaseResponse<CommentModel>
}